package com.fangxing.module.user.dao;

import com.fangxing.module.user.entity.AccountEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface AccountRepository extends JpaRepository<AccountEntity, String> {

    @Query("select e from AccountEntity e where e.cellphone=?1 and e.deleted=0")
    AccountEntity findByCellphone(String s);

    @Query("select e from AccountEntity e where e.email=?1 and e.deleted=0")
    AccountEntity findByEmail(String s);

    @Query("select e from AccountEntity e where e.username=?1 and e.deleted=0")
    AccountEntity findByUsername(String s);
}
